import request from '@/utils/request'

export function getDictTemplate(dictId) {
  return request({
    url: `/yxdd/dictTemplate/findBy/${dictId}`,
    method: 'post'
  })
}

export function getDictTree(dictId) {
  return request({
    url: `/yxdd/dict/tree`,
    method: 'post'
  })
}

export function getDictDataList(params) {
  return request({
    url: `/yxdd/dictData/list`,
    method: 'post',
    data: params
  })
}

/**
 *
 * @param dictObj
 * @returns {AxiosPromise}
 * {
 *   czs:'',
 *   dictDataDistributedId:''
 *   dictId:'',
 *   list:[
 *     {
 *       dictData:'1', 必传
 *       dictDataField:'hx', 必传
 *       dictDataFieldName:'航向',
 *     }
 *   ]
 * }
 */
export function dictDataAddOrUpdate(dictObj) {
  return request({
    url: `/yxdd/dictData/save`,
    method: 'post',
    data: dictObj
  })
}
export function getDictDataSaveOrUpdate(dictObj) {
  return request({
    url: `/yxdd/dictData/save`,
    method: 'post',
    data: dictObj
  })
}
export function removeDict(dictDataDistributedId) {
  return request({
    url: `/yxdd/dictData/delete/${dictDataDistributedId}`,
    method: 'post'
  })
}
// 获取船闸所下拉列表 带权限
// 2023-6-1 带权限的 下辖船闸所列表查询, 可以不用传入任何参数, 后台自动根据账户去判断??? 是的
export function getDropDownCz(params) {
  return request({
    url: `/yxdd/czzs/getDropDownCz`,
    method: 'post',
    data: params
  })
}

//获取船闸所信息 不带权限
export function allCzsSelect(data) {
  return request({
    url: '/user-center/jggl/getCzsList',
    method: 'post',
    data: data
  })
}

// 获取通用队列名称字典
export function getDDDLCheckType(params) {
  return request({
    url: `/yxdd/dictData/listByZdlx`,
    method: 'post',
    data:params
  })
}

// 获取混放规则列表

export function getHFGZlist(params) {
  return request({
    url: `/yxdd/hfgz/list`,
    method: 'post',
    data:params
  })
}

export function saveList(params) {
  return request({
    url: `/yxdd/hfgz/save`,
    method: 'post',
    data:params
  })
}

// 获取流程阻断数据

export function findBlockDetail(params) {
  return request({
    url: `/yxdd/block/findBlockDetail`,
    method: 'post',
    data:params
  })
}

// 修改阻断状态

export function zdztSave(params) {
  return request({
    url: `/yxdd/block/zdztSave`,
    method: 'post',
    data:params
  })
}
